<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="../css/common.css" />
<script src="../js/common/jquery.js"></script>
<script src="../js/common/drag.js"></script>
<script src="../js/common/angular.min.js"></script>
<script type="text/javascript" src="../js/common/common.js"></script>
<script type="text/javascript" src="../js/directive/ng-if.js"></script>
</head>
<body ng-app="myApp">

<div class="dqwz">
    <span>当前位置：</span>
    <span>ng-if</span>
</div>

<section>
    <div ng-controller="myCtrl">
        <h3>【移除 HTML 元素】</h3>
        <p><button type="button" ng-click="toggle()">移除/添加html元素</button></p>
        <div>
            <div ng-if="remove">
                ng-if 指令不同于 ng-hide， ng-hide 隐藏元素，而 ng-if 是从 DOM 中移除元素。
            </div>
        </div>
        <p>{{remove}}</p>
        <!-- 查看源码开始 -->
        <div class="htmlCode">
            <span>【html源码】</span>
            <xmp ng-non-bindable>
<p><button type="button" ng-click="toggle()">移除/添加html元素</button></p>
<div>
    <div ng-if="remove">
        ng-if 指令不同于 ng-hide， ng-hide 隐藏元素，而 ng-if 是从 DOM 中移除元素。
    </div>
</div>
            </xmp>
            <span>【js源码】</span>
            <xmp>
app.controller('myCtrl',function($scope){
    $scope.remove = true;
    $scope.toggle = function(){
        $scope.remove = !$scope.remove;
    }
})
            </xmp>
            <span class="close"><a href="javascript:;">关闭</a></span>
        </div>
        <div class="viewCode">
            <span><a href="javascript:;"> >>查看源码</a></span>
        </div>
        <!-- 查看源码结束 -->
    </div>
</section>

<div class="mask_layer">
</div>

</body>
</html>